#!/bin/sh
set -e

help_msg="Usage: $0 [-a <arg-a>] [-b <arg-b>] [-c] [-h]
This is help_msg.

       -a arg-a.
       -b arg-b.
       -c arg-c.
       -h help.
"

while getopts ":a:b:ch" opt; do
  case "${opt}" in
    a)
      arg_a="$OPTARG"
      ;;
    b)
      arg_b="$OPTARG"
      ;;
    c)
      arg_c=1
      ;;
    h)
      echo "$help_msg" >&2
      exit
      ;;
    \?)
      echo "$help_msg" >&2
      exit 1
      ;;
  esac
done
shift $((OPTIND -1))

# shellcheck disable=SC2016
printf 'Arguments:
  arg-a is %s
  arg-b is %s
  arg-c is %s
  $1 is %s
  $2 is %s
' "$arg_a" "$arg_b" "$arg_c" "$1" "$2"

